package ${basePackage};

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import net.fongtech.base.controller.BaseController;
import net.fongtech.test.entity.${javaEntityName};
import net.fongtech.test.service.${javaEntityName}Service;

/**
 * ${tableDescribe}
 * @author ${author}
 *
 */
@RestController
@RequestMapping("/api/${apiPathPrefix}")
public class ${javaEntityName}Controller extends BaseController {
	
    @Autowired
    private ${javaEntityName}Service ${propertieEntityName}Service;
    

	/**
	 * 列表查询
	 */
	@GetMapping(value = "/list${javaEntityName}", produces = MediaType.APPLICATION_JSON_VALUE)
	public String list${javaEntityName}(${javaEntityName} ${propertieEntityName}) {
		List<${javaEntityName}> result = ${propertieEntityName}Service.list${javaEntityName}s(${propertieEntityName});
		return renderAPIResult(0, "成功", result);
	}
	
	/**
	 * 修改
	 */
	@PostMapping(value = "/update${javaEntityName}", produces = MediaType.APPLICATION_JSON_VALUE)
	public String update${javaEntityName}(@RequestBody ${javaEntityName} ${propertieEntityName}) {
		return renderAPIResult(0, "成功", "");
	}
	
}
